Home > biomechZoo > Toolbox > Support Functions > makevalidfield.m

makevalidfield

PURPOSE ^

ch = makevalidfield(ch) fixes common invalid field names for structed

SYNOPSIS ^

function ch = makevalidfield(ch)

DESCRIPTION ^

 ch = makevalidfield(ch) fixes common invalid field names for structed
 arrays
 
 ARGUMENTS
   ch    ...   name of channel as string
   
 RETURNS
   ch    ...   new name of channel as string with invalid fieldnames removed
 

 Created by JJ Loh
 
 Updated by Phil Dixon Nov 2008
   - This function now uses recursion to fix channel names with multiple
     problems

 Updated by Phil Dixon Nov 2011
 - subcase ':' can handle invalid characters at the end of the field
 
 updated by Phil Dixon March 2013
 - added new cases

 Updated by Philippe C. Dixon May 2014
 - added new cases
 - use of 'strrep' to clean code

 Updated by Philippe C. Dixon Oct 2016
 - Removed '_' as invalid field
 - Added '^,=' as invalid fields
 - Truncates any field that exceeds MATLAB's maximum name length
 - Converts numeric channel names x to nx

 Updated by Oussama Jlassi and Philippe C. Dixon Aug 2023
 - Improved code execution speed
 -------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 10-Mar-2024 22:39:06 by m2html © 2005